Repository navigation
Fix --convert in workspaces, tag-aware changelog links, and single project discovery - #123
Merged
Merged
Conversation
- Remove dead `on.push.tags` trigger (tag pushes from workflows never trigger other workflows) - Dispatch `docker.yml` from `dispatch-publish.sh` with tag input - Add version resolution step to produce version-specific Docker tags (e.g. `0.1.6`) alongside `latest` - Upgrade Docker actions to Node.js 24 versions: build-push-action v7, login-action v4, metadata-action v6, setup-buildx-action v4
Dispatch docker.yml from dispatch-publish.sh with --ref pointing to the release tag so version-specific Docker tags are produced automatically. Upgrade Docker actions to Node.js 24 versions: build-push-action v7, login-action v4, metadata-action v6, setup-buildx-action v4. Remove unused inputs.tag from workflow_dispatch.
AddOperation, StatusOperation, VerifyOperation, ReleaseOperation and InitOperation take a LoadedProject instead of a start path, so each CLI handler discovers the project and loads its configuration exactly once. Their provider bounds no longer include ProjectDiscoverer or ChangesetConfigLoader. InitPlan::build replaces prepare_simple and the plan construction duplicated in the CLI.
The constructor, builder methods and execute paths now live in a single impl block bounded by ChangesetDirectoryProvider. Methods that need the manifest writer or the interaction provider declare those bounds at method level. The builder methods set the declared writer and interaction provider types instead of changing them.
…mand (#77) PrereleaseManageOperation, GraduationManageOperation, PrereleaseDirectOperation, GraduationDirectOperation, the additional-package operations and the version-tracking dependency operations no longer hold a project provider; their execute methods take a LoadedProject. The manage and additional-packages CLI handlers load the project once per invocation and pass it to the operation, so only LoadedProject::load uses ProjectDiscoverer and ChangesetConfigLoader.
…lls back Snapshot every manifest that inherits workspace.package.version while the conversion is prepared and restore those bytes in compensation. The step also restores already-converted manifests itself when a later manifest fails, and keeps restoring the rest when one restore fails, reporting the failures as typed errors. This replaces InheritedVersionWriter and write_inherited_version, which could only write the dotted form.
WorkspaceVersionConversion now holds each inheriting package's name, manifest path and snapshot, and the public InheritedVersionConversion summary is derived from it, so ReleaseContext no longer keeps a separate list of inherited package names. The workspace version comes from the inheriting packages, whose versions project discovery already resolved from workspace.package.version in the root manifest. WorkspaceVersionManager::read_workspace_version had no remaining caller and is removed.
InitOperation now takes its manifest writer through the constructor and only executes plans, so a config-writing init cannot run without a writer. Directory-only initialization moves to InitDirectoryOperation, and interactive planning moves to InteractiveInitPlanner, which is the only type that requires an InitInteractionProvider.
LoadedProject::load is the only consumer and always needs both project discovery and configuration loading, so the two traits become one.
…lback The lockfile backup and the changeset-file backups were recorded during execute, so their compensations, which receive the step's input from before it ran, never saw them and restored nothing. A Cargo.lock created by `cargo update` also survived the rollback. Snapshot Cargo.lock, the pending changeset files and, when graduating, the consumed changesets before the saga runs, and restore those bytes in compensation. A file that did not exist is captured as FileContent::Absent, so restoring it removes the file the release created. ManifestSnapshotIO becomes the general FileSnapshotIO, implemented by the manifest writer and the changeset IO, and ManifestRestoreFailure becomes FileRestoreFailure. The lockfile and changeset restore methods it replaces are removed.
…artway WriteManifestVersionsStep left the manifests it had already written when a later manifest failed, and its compensation rewrote versions instead of restoring the original files. A new SnapshotReleaseManifestsStep runs right after the inherited-version conversion and records, for every manifest the release writes, its target and the bytes before WriteManifestVersionsStep runs. That step's input is what compensation receives, so the snapshots reach it. WriteManifestVersionsStep restores the manifests it touched before returning an error, and its compensation restores every snapshot and reports each failed restore. Because the snapshots are taken after the conversion, each step restores the state from before itself, and rolling back both reproduces the original files exactly. InheritedVersionConversionRollbackFailed becomes the general StepRollbackFailed, which both steps report when undoing their own partial changes fails.
The CLI printed "Rollback completed successfully" for every failed step, even when the failed step could not undo its own changes (StepRollbackFailed), and listed compensation failures without the files that were left modified. RollbackOutcome decides from the saga error whether the rollback was complete, and collects for each step that could not be undone the files it did not restore. The error formatter only renders that outcome: success when complete, otherwise each step, its error and every unrestored path. Errors are now printed through CliWriter.
Clippy 1.100 adds assert_is_empty, which flags assert!(x.is_empty()). Replace those assertions with assert_eq!/assert_ne! against an empty value so failures print what was actually there.
cargo-changeset, changeset-core, changeset-parse and changeset-version did not opt into [workspace.lints], so clippy pedantic and unwrap_used never ran there. Enable them and satisfy every finding: expect() in tests instead of unwrap(), # Errors docs, #[must_use] on bump_version, flag groups via clap flatten to stay under the bool-field limit, Display-based plain-text formatters instead of format!-then-push_str, and long PTY/integration tests split into per-phase helpers. Also converts the assert_is_empty sites in these crates.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #77, closes #120, closes #121.
release --convertin workspaces (#120)--convertnow converts every crate that inheritsversion.workspace = trueto an explicit version, then removesworkspace.package.version. Before, crates that were not released were left with nothing to inherit.releaseand--dry-runoutput list the converted crates.Changelog comparison links (#121)
ReleaseTagNamerstrategy, shared by tag creation and changelog links, so links follow the configured tag format.[email protected]). This is now documented in the README, the release action docs, the CLI help and theinitprompt.comparison-links-templateis now honoured.ChangelogConfigselects the URL formatter.Single project discovery (#77)
ProjectProvideris split intoProjectLoader,ChangesetDirectoryProvider,AdditionalPackageDiscovererandDependencyGraphProvider.LoadedProjectis loaded once per command and passed to every operation, so the type system rules out discovering the project twice.InitOperationis split by the collaborators each step needs:InitDirectoryOperation,InitOperationandInteractiveInitPlanner.Release rollback
Cargo.lockand changeset files are snapshotted before the release runs and restored byte for byte on rollback. This also covers manifest writes that fail partway. Rollback deletes aCargo.lockthat the release created.Breaking API changes
These are in
changeset-operationsandchangeset-changelogand are covered bymajorchangesets.&LoadedProject.LockfileUpdaternow only hasupdate_lockfile.ChangesetWriterrestore methods are removed.ManifestSnapshotIOis nowFileSnapshotIO.Changelog::add_releaseandChangelogWriter::write_releasetake an optional comparison URL.Known gaps
These rollback gaps existed before this PR and remain open:
WriteVersionTrackingSteprecords its backups during execute, so its compensation restores nothing.UpdateDependencyVersionsStep,RemoveWorkspaceVersionStepandMarkChangesetsConsumedStepwrite values back rather than restoring the original bytes.workspace.package.versioncomes back at the end of the table, not in its original position.